package com.booter.merchant.service;

import com.booter.merchant.dao.MerchantMapper;
import com.booter.merchant.dao.MerchantOrderMapper;
import com.booter.merchant.dao.UserMapper;
import com.booter.model.Dict;
import com.booter.model.Merchant;
import com.booter.model.MerchantOrder;
import com.booter.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
public class MerchantOrderService {

	@Autowired
	private MerchantOrderMapper mapper;

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private MerchantMapper merchantMapper;


	@Transactional
	public Long insert(Merchant m) {
		return this.merchantMapper.insert(m);
	}

	@Transactional
	public int insert(MerchantOrder model) {
		return this.mapper.insert(model);
	}

	@Transactional
	public int insertDict(Dict dict) {
		return this.mapper.insertDict(dict);
	}

	@Transactional
	public Long insertUser(User dict) {
		return this.userMapper.insertUser(dict);
	}


	public List<MerchantOrder> getByMid(Long mid) {
		return this.mapper.getByMid(mid);
	}


	public int delete(Long id, Long mid) {
		return this.mapper.deleteById(id, mid);
	}


	public List<MerchantOrder> selectList(Map<String, Object> param) {
		return this.mapper.selectList(param);
	}

	public List<MerchantOrder> selectMList(Map<String, Object> param) {
		return this.mapper.selectMList(param);
	}
}
